package com.college.heyuhua.dao;

import com.college.heyuhua.model.FoundInfo;
import com.college.heyuhua.model.LostInfo;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Created by 赵东坡 on 2019/2/5.
 * Time:22:59
 * 宇宙无敌赵牛逼，祈求永无bug
 */
@Mapper
@Component
public interface FoundMapper {


    @Insert("<script>" +
            "insert into foundinfo (foundthings,foundaddress,founddate,contract,telephone,uid) " +
            " values( #{info.foundthings},#{info.foundaddress},#{info.founddate},#{info.contract},#{info.telephone},#{info.uid}) " +
            "</script>")
    boolean insertFoundInfo(@Param("info")FoundInfo foundInfo);


    @Select("<script>" +
            "select * " +
            "from foundinfo " +
            "order by fid desc " +
            "limit 100 " +
            "</script>")
    List<FoundInfo> foundList();

    @Delete("<script>" +
            "delete from foundinfo where fid = #{fid}" +
            "</script>")
    boolean deletef(@Param("fid")String fid);
}
